import { ResponseDataType } from '@/types/response'

export function responseSuccess<T = any> (data: T, message = ''): ResponseDataType<T> {
  return {
    code: 0,
    data,
    message
  }
}

export function responseError<T = any> (data: T, message = '操作失败'): ResponseDataType<T> {
  return {
    code: -1,
    data,
    message
  }
}
